<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Illuminate\Queue\Capsule\Manager;
use Session;
use DB;
use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\Redirect;
use App\UserAccountSuggest;

class UserAccountSuggestController extends Controller
{
    public function __construct()
    {
        $this->middleware('auth');
    }

	public function index(Request $request) {
		$phone = '';
		if($request->input('phoneSearch')){
			$phone = trim($request->input('phoneSearch'));
		}

		$userSg = UserAccountSuggest::getUserAccountSuggest($phone);
		if($userSg){
			foreach ($userSg as $key=>$value){
				if($value->check_text){
					$value->check_text = explode(',',$value->check_text);
				}
			}
		}

		$data['suggestList'] = $userSg;
		$data['phoneS'] = $phone;

		return view('userAccountSuggest.list')->with($data);
	}



}





